package com.ruoyi.carowner.service.impl;

import java.util.List;

import com.ruoyi.carowner.domain.CarownerKm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.carowner.mapper.CarownerKmLogMapper;
import com.ruoyi.carowner.domain.CarownerKmLog;
import com.ruoyi.carowner.service.ICarownerKmLogService;

/**
 * 兑换记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-17
 */
@Service
public class CarownerKmLogServiceImpl implements ICarownerKmLogService {
    @Autowired
    private CarownerKmLogMapper carownerKmLogMapper;

    /**
     * 查询兑换记录
     *
     * @param id 兑换记录主键
     * @return 兑换记录
     */
    @Override
    public CarownerKmLog selectCarownerKmLogById(Integer id) {
        return carownerKmLogMapper.selectCarownerKmLogById(id);
    }

    /**
     * 查询兑换记录列表
     *
     * @param carownerKmLog 兑换记录
     * @return 兑换记录
     */
    @Override
    public List<CarownerKmLog> selectCarownerKmLogList(CarownerKmLog carownerKmLog) {
        return carownerKmLogMapper.selectCarownerKmLogList(carownerKmLog);
    }


    @Override
    public List<CarownerKmLog> selectKmlt(Integer user_id) {
        return carownerKmLogMapper.selectKmlt(user_id);
    }

    @Override
    public List<CarownerKmLog> selectKmgtByUserid(Integer user_id) {
        return carownerKmLogMapper.selectKmgtByUserid(user_id);
    }

    /**
     * 新增兑换记录
     *
     * @param carownerKmLog 兑换记录
     * @return 结果
     */
    @Override
    public int insertCarownerKmLog(CarownerKmLog carownerKmLog) {
        return carownerKmLogMapper.insertCarownerKmLog(carownerKmLog);
    }

    /**
     * 修改兑换记录
     *
     * @param carownerKmLog 兑换记录
     * @return 结果
     */
    @Override
    public int updateCarownerKmLog(CarownerKmLog carownerKmLog) {
        return carownerKmLogMapper.updateCarownerKmLog(carownerKmLog);
    }

    /**
     * 批量删除兑换记录
     *
     * @param ids 需要删除的兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteCarownerKmLogByIds(Integer[] ids) {
        return carownerKmLogMapper.deleteCarownerKmLogByIds(ids);
    }

    /**
     * 删除兑换记录信息
     *
     * @param id 兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteCarownerKmLogById(Integer id) {
        return carownerKmLogMapper.deleteCarownerKmLogById(id);
    }
}
